import threading


class SingleData:
    __instance = False
    _lock = threading.Lock()

    doctor = {}
    health = {}
    manage = {}
    h = {}
    h_health = {}

    @classmethod
    def _acquire_lock(cls):
        cls._lock.acquire()

    @classmethod
    def _release_lock(cls):
        cls._lock.release()

    def __new__(cls, *args, **kwargs):
        with cls._lock:
            if not cls.__instance:
                cls.__instance = super().__new__(cls)
            return cls.__instance
